package com.csmht.tododemo.mapper;

import com.csmht.tododemo.annotation.AutoFill;
import com.csmht.tododemo.pojo.entity.Ban;
import com.csmht.tododemo.pojo.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface BanMapper {

    @AutoFill(OperationType.ONE)
    void ban(Ban ban);


    @Select("SELECT * from ban where user_id = #{id} and ddl > #{now}")
    List<Ban> getBanTimeByUserId(Long id,LocalDateTime now);
}
